# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=dtkgui
pkgver=5.6.19
pkgrel=1
epoch=1
pkgdesc='Deepin Toolkit, gui module for DDE look and feel'
arch=('loong64' 'x86_64')
url="https://github.com/linuxdeepin/dtkgui"
license=('LGPL3')
depends=('dtkcore' 'freeimage' 'libraw' 'libqtxdg' 'librsvg' 'qt5-base' 'glib2' 'libx11' 'gcc-libs')
makedepends=('cmake' 'ninja' 'qt5-tools' 'gtest' 'doxygen')
source=("https://github.com/linuxdeepin/dtkgui/archive/$pkgver/$pkgname-$pkgver.tar.gz")
sha512sums=('fe3842841cfb3968cc0c7db6b62b2d1c28601eb098086a216c3f0b760ed88c205a667de7b6726f1b1bb8e230214ea7a531f7912c615acb2dcd7262628f2cd80e')

build() {
  cd dtkgui-$pkgver
  cmake . -GNinja \
    -DMKSPECS_INSTALL_DIR=lib/qt/mkspecs/modules/ \
    -DBUILD_DOCS=ON \
    -DBUILD_TESTING=ON \
    -DQCH_INSTALL_DESTINATION=share/doc/qt \
    -DCMAKE_INSTALL_LIBEXECDIR=lib \
    -DCMAKE_INSTALL_LIBDIR=lib \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DDTK_VERSION=$pkgver
  ninja
}

check() {
  cd dtkgui-$pkgver
  # TODO
  ninja test || echo "Tests failed"
}

package() {
  cd dtkgui-$pkgver
  DESTDIR="$pkgdir" ninja install
}
